cmake_minimum_required(VERSION 3.10)
project(MyProject)
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)


# 设置C++标准
set(CMAKE_CXX_STANDARD 14)

# 包含头文件目录
include_directories(include)

# 添加可执行文件
add_executable(MyProject src/main.cpp src/MyClass.cpp)

# 添加测试
enable_testing()
add_executable(test_MyProject test/test_main.cpp test/test_MyClass.cpp src/MyClass.cpp)
target_link_libraries(test_MyProject gtest gtest_main pthread)
add_test(NAME MyProjectTest COMMAND test_MyProject)

# 设置输出目录
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/lib)